﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RoboZip
{
    /// <summary>
    /// All available program options.
    /// </summary>
    public enum ExecutionOptions { MP, START, FNP, DS, UD }

    /// <summary>
    /// The possible arguments for the option /MP (Monitoring Period).
        /// </summary>
    public enum MonitoringPeriod { n, h, d, w, m, y, a }

    /// <summary>
    /// The possible argumetns for the option /FNP (File Name Pattern).
    /// </summary>
    public enum FileNamePattern { yyyy, yy, mm, ww, dd, hh, nn }

    /// <summary>
    /// NoError: No error occured
    /// HelpAsked: User typed "/?"
    /// NoArguments: User passed no arguments at all
    /// OnlyOneArgument: User passed only one argument
    /// Source: Error in source name/path
    /// Destination: Error in destination name/path
    /// FileName: Error in passing file names
    /// OptionUnknown: Error in passing option
    /// OptionMissingParameter: Missing parameter for option
    /// OptionGeneralError: Error like passing an option twice
    /// </summary>
    public enum ErrorNumber { NoError, HelpAsked, NoArguments, OnlyOneArgument, Source,
        Destination, FileName, OptionUnknown, OptionParameterMissing, OptionParameterUnknown, 
        OptionPassedTwice, OptionGeneralError }

    public interface IJob
    {
        /// <summary>
        /// GUID added when new job is created.
        /// </summary>
        Guid GUID {get;}

        /// <summary>
        /// Simply counts the executions since start.
        /// </summary>
        long ExecutionCounter { get; set; }

        /// <summary>
        /// Specifies the source path for the zip file.
        /// </summary>
        /// <remarks>Actually no sub folders are supported.</remarks>
        /// <value>Local or network path.</value>
        String SourcePath { get; set; }

        /// <summary>
        /// Specifies the destination path for the zip file.
        /// </summary>
        /// <value>Local or network path.</value>
        String DestinationPath { get; set; }

        /// <summary>
        /// Specifies the file(s) to copy  (names/wildcards: default is "*.*")
        /// </summary>
        List<String> FileList { get; set; }

        /// <summary>
        /// The monitoring period set by the user.
        /// </summary>
        Nullable<MonitoringPeriod> MonitoringPeriod { get; set; }

        /// <summary>
        /// The timestamp to start the job.
        /// </summary>
        Nullable<DateTime> Start { get; set; }

        /// <summary>
        /// The pattern to use when generationg file names.
        /// </summary>
        String FileNamePattern { get; set; }

        /// <summary>
        /// Specifies if a source file should be deleted after adding to a zip file.
        /// </summary>
        /// <value>
        /// True: Delete the source file.
        /// False: Do not delete the source file.
        /// </value>
        Nullable<Boolean> DeleteSource { get; set; }

        /// <summary>
        /// Specifies if the zip file should be updated with a newer version of a file.
        /// </summary>
        /// <value>
        /// True: Updated the destination.
        /// False: Do not updated the destination.
        /// </value>
        Nullable<Boolean> UpdateDestination { get; set; }

        /// <summary>
        /// Specific error number. Zero = no error.
        /// </summary>
        ErrorNumber ErrorNumber { get; set; }
        
        /// <summary>
        /// A string to store an error description.
        /// </summary>
        String ErrorDescription { get; set; }
        
    }
}
